* TEST POST-TEST NO THREAT
	local r=1
	eststo clear
	estimates clear
	
	label var posttest_ntc4 "Unmonitored Placebo"
	
foreach outcomevar of varlist read_std math_std {
		
		preserve
		
		gen pos_ntp3 = nothreat_p3 > 0
		
		global controlvar pos_ntp3
		
			
		if "`outcomevar'" == "math_std" {
			keep if subject == "Math"
			local outcomename "m"
			}
		else if "`outcomevar'" == "read_std" {
			keep if subject == "ELA"
			local outcomename "r"
			}
		
		quiet{
				
				
						
				eststo model`r': areg `outcomevar' $nothreatvars $prevvars $gradevar $controlvar i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
				global my_cmd `e(cmdline)'
				global my_num `r'
				*do "$code_dir\Randomization Inference.do"
				local r=`r'+1
																	
				* sample 2 -> w/ prev. stud. info
				eststo model`r': areg `outcomevar' $nothreatvars $prevvars $gradevar $experiencevar $sdemovars  $controlvar i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
				global my_cmd `e(cmdline)'
				global my_num `r'
				*do "$code_dir\Randomization Inference.do"
				local r=`r'+1
				
			
				eststo model`r': areg `outcomevar' $nothreatvars $prevvars $gradevar $experiencevar $sdemovars  $feedbackvars $controlvar i.year i.sch_id $yeardosevar, absorb(id) vce(cluster _id_year)
				global my_cmd `e(cmdline)'
				global my_num `r'
				*do "$code_dir\Randomization Inference.do"
				local r=`r'+1
				
				local namevar "linear"
			}
			if strpos("$nothreatvars","i.year") | strpos("$nothreatvars", "i.grade") {
				local keepvars "*nothreat_*"
				} 
			else {
				local keepvars $nothreatvars
				}
		
		
		* 
		

		* return stored estimates to their previous state
		restore
		}
		
		
		estfe model*, labels(id "Teacher FE")
		return list
		*
		esttab model* using "$output_dir\Tables\\_Table_21_both.tex", ///
			indicate( "Previous Student Scores = math_std_t" ///
					       "Teacher Experience=*xp*" "Student Demographics = *.male" "Feedback Time=postconf_*" , labels("X" " ")) ///
			cells("b(${stars} fmt(%5.4fc) label(!))" "se(par fmt(%5.4fc) label(!))" "LB(fmt(%5.4fc) par(zz ) label(!)) & UB(fmt(%5.4fc) par(qq ww) label(!))") ///
			keep(`keepvars', relax) substitute(zz "[" qq " " ww "]" ! " " / "") starlevels(\$^+\$ 0.10 * 0.05 ** 0.01 *** 0.001) gaps nonotes ///
			mgroups(Reading Math, pattern(1 0 0 1 0 0)                   ///
				prefix(\multicolumn{@span}{c}{) suffix(})   ///
				span erepeat(\cmidrule(lr){@span}))         ///
			label nodepvars eqlabels(none) nomtitles nolegend replace 
	
		estfe model*, restore	
	
	/*
	estfe model*, labels(id "Teacher FE")
			return list
			*`r(indicate_fe)' "School FE=*.sch_id" "Year FE = *.year" "Grade FE = *grade*" 
			esttab model* using "$output_dir\Tables\\_${tablenum}_both_COMPLETE.tex", ///
				indicate("Previous Student Scores = math_std_t" ///
					"Teacher Experience=*xp*" "Student Demographics = *.male" , labels("X" " ")) ///
				cells("b(${star} fmt(%5.4fc) label(!))" "se(par fmt(%5.4fc) label(!))" "LB(fmt(%5.4fc) par(zz ) label(!)) & UB(fmt(%5.4fc) par(qq ww) label(!))") ///
				keep(`keepvars', relax) substitute(zz "[" qq " " ww "]" ! " " / "") starlevels(\$^+\$ 0.10 * 0.05 ** 0.01 *** 0.001) gaps nonotes ///
				mgroups(Reading Math, pattern(1 0 0 1 0 0)                   ///
					prefix(\multicolumn{@span}{c}{) suffix(})   ///
					span erepeat(\cmidrule(lr){@span}))         ///
				label nodepvars eqlabels(none) nomtitles nolegend replace 
			estfe model*, restore	
			
	*/
	
	
	
	